<template>
  <!-- 分享店铺 -->
  <button open-type="share" data-share="shop">分享店铺</button>
  <!-- 分享单个商品 -->
  <button
    open-type="share"
    data-share="goods"
    :data-goods-id="goodsId">分享商品</button>
</template>

<script setup>
import { onShareAppMessage } from '@dcloudio/uni-app'

/* 分享生命周期 */
onShareAppMessage((e) => {
  if (e.from === 'menu') {
    /* 用户端小程序信息 */
    const userAppId   = 'wxffc65586a5e155ed' // 用户端小程序 AppID
    // const shopId      = '10001'              
    // const path        = share === 'shop'
    //   ? `/pages/shop/shop?scene=${shopId}`
    //   : `/pages/shop/shop?scene=${goodsId}_${shopId}`
    
	
	
	const path   = `/pages/shop/shop?share=true`
    return {
      title :  '欢迎光临本店，优惠多多！' ,
      path,
      // 指定跳转到「用户端」小程序
      appId : userAppId,
	  imageUrl: '/static/card.png' 
    
	   
    }
  }
  
})
</script>